//
//  mmjWaterFlow.h
//  瀑布流
//
//  Created by 梅敏杰 on 2018/6/7.
//  Copyright © 2018年 梅敏杰. All rights reserved.
//

#import <UIKit/UIKit.h>
@class mmjWaterFlow;

//自定义代理类
@protocol mmjWaterflowLayoutDelegate <NSObject>

@required
- (CGFloat)waterflowLayout:(mmjWaterFlow *)waterflowLayout heightForItemAtIndex:(NSUInteger)index itemWidth:(CGFloat)itemWidth;

@optional
- (CGFloat)columnCountInWaterflowLayout:(mmjWaterFlow *)waterflowLayout;
- (CGFloat)columnMarginInWaterflowLayout:(mmjWaterFlow *)waterflowLayout;
- (CGFloat)rowMarginInWaterflowLayout:(mmjWaterFlow *)waterflowLayout;
- (UIEdgeInsets)edgeInsetsInWaterflowLayout:(mmjWaterFlow *)waterflowLayout;

@end





@interface mmjWaterFlow : UICollectionViewLayout
    //创建一个数组，存放所有的cell的布局属性
@property (nonatomic,strong) NSMutableArray * array;
/** 存放所有列的当前高度 */
@property (nonatomic,strong) NSMutableArray * columnHeights;

//代理
@property (nonatomic,weak) id<mmjWaterflowLayoutDelegate> delegate;
//声明
-(CGFloat)rowMargin;
-(CGFloat)columMargin;
-(NSInteger)columCount;
-(UIEdgeInsets)edgeInsets;
@end
